from django.apps import AppConfig
from ImageModule.utils.customstorage import CustomStorage
from airport_logistics_backend import settings

# class SystemconfigurationConfig(AppConfig):
#     name = 'SystemConfiguration'
#     default_auto_field = "django.db.models.BigAutoField"

    # def ready(self):
        # from .models import VideoPath
        # 从这里导入模型和其他所需的东西
        # 执行你的数据库操作
        # video_path = VideoPath.objects.all()
        # latest_entry = VideoPath.objects.order_by('-id').first().path

        # ... 其他的初始化操作
        # settings.CUSTOM_STORAGE_LOCATION = latest_entry
        # storage = CustomStorage(location = settings.CUSTOM_STORAGE_LOCATION,base_url='')
        # storage.set_location(new_location = settings.CUSTOM_STORAGE_LOCATION)

# class SystemconfigurationConfig(AppConfig):
#     default_auto_field = "django.db.models.BigAutoField"
#     name = "SystemConfiguration"
